package com.a;

import java.util.Scanner;

public class c {
    public static void main(String[] args) {

        Scanner us=new Scanner(System.in);
        System.out.println("请输入想要算的n个和");

        int n=us.nextInt();
        System.out.println(sum(n));
    }

    public static int sum(int n)
    {
        int sum1=0;
        for(int i=1;i<=n;i++)
        {
            sum1+=i;
        }
        return sum1 ;
    }
}
